using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class newsletterMap : EntityTypeConfiguration<newsletter>
    {
        public newsletterMap()
        {
            // Primary Key
            this.HasKey(t => t.newsletter_id);

            // Properties
            this.Property(t => t.newsletter_title)
                .HasMaxLength(500);

            this.Property(t => t.newsletter_author)
                .HasMaxLength(50);

            this.Property(t => t.newsletter_create_by)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("newsletter");
            this.Property(t => t.newsletter_id).HasColumnName("newsletter_id");
            this.Property(t => t.newsletter_title).HasColumnName("newsletter_title");
            this.Property(t => t.newsletter_content).HasColumnName("newsletter_content");
            this.Property(t => t.newsletter_submit_time).HasColumnName("newsletter_submit_time");
            this.Property(t => t.newsletter_send_time).HasColumnName("newsletter_send_time");
            this.Property(t => t.newsletter_author).HasColumnName("newsletter_author");
            this.Property(t => t.newsletter_send_type_flag).HasColumnName("newsletter_send_type_flag");
            this.Property(t => t.newsletter_send_to_flag).HasColumnName("newsletter_send_to_flag");
            this.Property(t => t.newsletter_sms_content).HasColumnName("newsletter_sms_content");
            this.Property(t => t.newsletter_status).HasColumnName("newsletter_status");
            this.Property(t => t.newsletter_open_flag).HasColumnName("newsletter_open_flag");
            this.Property(t => t.newsletter_create_by).HasColumnName("newsletter_create_by");
        }
    }
}
